import {
  BwCustomComSoltTypeEnum,
  BwCustomComNodeAttrDataTypeEnum,
  BwCustomComNodeAttrFromTypeEnum,
  BwCustomComSlotParamDataTypeEnum,
  type BwCustomComNodeAttrModel,
  type BwCustomComNodeEnableSlotInfoModel,
} from '../../../../render/models'

const attrs: Record<string, BwCustomComNodeAttrModel> = {
  options: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.object,
    constValue: '[]',
  },
  placeholder: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.string,
    constValue: '请选择',
  },
  activeColor: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.string,
    constValue: '#1989fa',
  },
  swipeable: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.boolean,
    constValue: 'true',
  },
  closeable: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.boolean,
    constValue: 'true',
  },
  showHeader: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.boolean,
    constValue: 'true',
  },
  closeIcon: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.string,
    constValue: 'cross',
  },
  fieldNames: {
    valueFromType: BwCustomComNodeAttrFromTypeEnum.constValue,
    valueDataType: BwCustomComNodeAttrDataTypeEnum.object,
    constValue: JSON.stringify({
      text: 'text',
      value: 'value',
      children: 'children',
    }),
  },
}

const slotList: Array<BwCustomComNodeEnableSlotInfoModel> = [
  {
    visible: false,
    slotType: BwCustomComSoltTypeEnum.convention,
    conventionSlotInfo: {
      slotCode: 'title',
      slotName: '自定义顶部标题',
    },
  },
  {
    visible: false,
    slotType: BwCustomComSoltTypeEnum.convention,
    conventionSlotInfo: {
      slotCode: 'option',
      slotName: '自定义选项文字',
      slotParams: [
        {
          paramKey: 'option',
          paramName: 'option',
          paramDataType: BwCustomComSlotParamDataTypeEnum.object,
          remark: '',
        },
        {
          paramKey: 'selected',
          paramName: 'selected',
          paramDataType: BwCustomComSlotParamDataTypeEnum.boolean,
          remark: '',
        },
      ],
    },
  },
  {
    visible: false,
    slotType: BwCustomComSoltTypeEnum.convention,
    conventionSlotInfo: {
      slotCode: 'options-top',
      slotName: '自定义选项上方的内容',
      slotParams: [
        {
          paramKey: 'tabIndex',
          paramName: 'tabIndex',
          paramDataType: BwCustomComSlotParamDataTypeEnum.number,
          remark: '',
        },
      ],
    },
  },
  {
    visible: false,
    slotType: BwCustomComSoltTypeEnum.convention,
    conventionSlotInfo: {
      slotCode: 'options-bottom',
      slotName: '自定义选项下方的内容',
      slotParams: [
        {
          paramKey: 'tabIndex',
          paramName: 'tabIndex',
          paramDataType: BwCustomComSlotParamDataTypeEnum.number,
          remark: '',
        },
      ],
    },
  },
]

export const vanCascaderOptions = {
  attrs,
  slotList,
}
